package com.nwpusp.display.views.components;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;

import com.example.petssports.R;
import com.nwpusp.display.GlobalVar;

public class BackGround extends View{
	private Bitmap bgBitmap;
	private int index;
	public float x;
	public float y;
	public float scale;
	public float width;
	public float height;
	 
	
	public BackGround(Context view,float scale,int index){
		super(view);
		this.scale = scale;
		this.index = index;
		getBitmapSource();
		//bgBitmap = GlobalVar.VerticalScale(bgBitmap,scale);
		if(index < 10){
			bgBitmap = GlobalVar.FixScreen(bgBitmap);
		}
		width = bgBitmap.getWidth();
		height = bgBitmap.getHeight();
	}
	
	public void setLocation(float x ,float y){
		this.x = x;
		this.y = y;
	}
	
	private void getBitmapSource(){
		switch (index) {
		case GlobalVar.StartViewBackGround:{
			bgBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.startviewbg);
			break;
		}
		case GlobalVar.CreateViewBackGround:{
			bgBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.createviewbg);
			break;
		}
		case GlobalVar.WaitingViewBackGround:{
			bgBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.waitingviewbg);
			break;
		}
		default:
			break;
		}
	}
		
	public Bitmap draw(){
		return bgBitmap;
	}
}
